﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace ProjetLabo
{
    /// <summary>
    /// Logique d'interaction pour Step2Window.xaml
    /// </summary>
    public partial class Step2Window : Window
    {
        public Step2Window()
        {
            InitializeComponent();

            this.HideImportControls();

        }

        private void IsImportChecked(object sender, RoutedEventArgs e)
        {
            this.ShowImportControls();
            this.CreateCB.IsChecked = false;
        }

        private void IsCreateChecked(object sender, RoutedEventArgs e)
        {
            this.HideImportControls();
            this.ImportCB.IsChecked = false;
        }

        private void HideImportControls()
        {
            this.DBLoginInput.IsEnabled = false;
            this.DBNameInput.IsEnabled = false;
            this.DBPasswordInput.IsEnabled = false;

            this.DBLoginLabel.Foreground = new SolidColorBrush(Colors.Gray);
            this.DBNameLabel.Foreground = new SolidColorBrush(Colors.Gray);
            this.DBPasswordLabel.Foreground = new SolidColorBrush(Colors.Gray);
        }

        private void ShowImportControls()
        {
            this.DBLoginInput.IsEnabled = true;
            this.DBNameInput.IsEnabled = true;
            this.DBPasswordInput.IsEnabled = true;

            this.DBLoginLabel.Foreground = new SolidColorBrush(Colors.Black);
            this.DBNameLabel.Foreground = new SolidColorBrush(Colors.Black);
            this.DBPasswordLabel.Foreground = new SolidColorBrush(Colors.Black);
        }

        
    }
}
